<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title></title>
    <style>
      .waterfall-container {
        column-count: 2; /* 设置列数为2 */
        column-gap: 20px; /* 列间距 */
        width: 800px; /* 容器宽度 */
        margin: 0 auto; /* 居中显示 */
      }
      
      .waterfall-item {
        break-inside: avoid; /* 防止元素被分割到不同列 */
        margin-bottom: 20px; /* 元素间距 */
      }
      
      .waterfall-item img {
        width: 100%; /* 图片宽度占满容器 */
        height: auto; /* 高度自适应 */
        display: block; /* 防止图片底部出现空隙 */
      }
    </style>
  </head>
  <body>
    <div class="waterfall-container">
      <div class="waterfall-item">
        <img src="https://picsum.photos/400/600" alt="瀑布流图片">
      </div>
      <div class="waterfall-item">
        <img src="https://picsum.photos/400/400" alt="瀑布流图片">
      </div>
      <div class="waterfall-item">
        <img src="https://picsum.photos/400/500" alt="瀑布流图片">
      </div>
      <div class="waterfall-item">
        <img src="https://picsum.photos/400/300" alt="瀑布流图片">
      </div>
      <div class="waterfall-item">
        <img src="https://picsum.photos/400/700" alt="瀑布流图片">
      </div>
    </div>
    <script>
    </script>
  </body>
</html>
